package cn.liutao.common.enums;

import lombok.Getter;

/**
 * @author: liutao
 * @description: 支付枚举
 * @date: 2023/12/13 14:59
 */
@Getter
public enum PayEnum {
    PAY_STATUS_NO_BUY(0,"待支付"),
    PAY_STATUS_BUY_SUCCESS(1,"支付成功"),
    PAY_METHOD_BALANCE(0,"余额支付"),
    PAY_METHOD_ALIPAY(1,"支付宝"),
    PAY_TYPE_EXCHANGE(0,"余额充值"),
    PAY_TYPE_BUY(1,"点餐支付")
    ;

    private final Integer intValue;
    private final String desc;

    PayEnum(Integer value, String desc) {
        this.intValue = value;
        this.desc = desc;
    }

    public static PayEnum getByValue(int intValue){
        for (PayEnum constants : values()) {
            if (constants.getIntValue() == intValue) {
                return constants;
            }
        }
        return PAY_STATUS_NO_BUY;
    }
}
